<template>
	<view class="column-css">
		<!-- <uni-steps
			style="padding-top: 40rpx;"
			activeColor="#2979FF"
			:options="[{ title: '录入个人信息' }, { title: '录入车辆信息' }, { title: '录入收款信息' }]"
			:active="0"
		></uni-steps> -->
		<view class="column-css view-cente">
			<view class="row-css view-cente-cle">
				<view class="view-cente-cle-text">所属承运商</view>
				<view style="position: relative;flex: 1;margin-top: -3rpx;z-index: 999;">
					<input v-model="etpName" placeholder="请输入承运企业全称" />
					<input v-model="driverreg.etpName" v-show="false" placeholder="请输入承运企业全称" />
					<view class="ul">
						<view class="li" v-for="(item, index) in list" :key="index" @click="select(item)">{{ item.etpName }}</view>
					</view>
				</view>
				<image style="width: 38rpx;height: 33rpx;margin-left: 10rpx;" mode="aspectFit" @click="oncard" src="../../static/icon_scan.png"></image>
			</view>
		</view>
		<view class="row-css view-cente view-cente-cle" style="justify-content: space-between;align-items: center;margin: 0 30rpx;">
			<view class="row-css">
				<view class="view-cente-cle-text">当前手机号</view>
				<view>{{ userInfo.mobile }}</view>
			</view>
			<view v-if="isupdata == false" style="color: #4CD964;" @click="updatipone()">修改手机</view>
		</view>
		<view v-if="isupdata" class="row-css view-cente view-cente-cle" style="margin: 0 30rpx;">
			<view class="view-cente-cle-text">新手机号</view>
			<view class="row-css">
				<form><input v-model="newphone" type="phone" maxlength="11" onkeyup="this.value=this.value.replace(/\D/g,'')" placeholder="请输入新手机号" /></form>
			</view>
		</view>
		<view v-if="isupdata" class="row-css view-cent view-cente-cle" style="margin: 0 30rpx;border-bottom: 0rpx;">
			<view class="view-cente-cle-text" style="border-bottom: 1rpx solid #F1F1F1;display: flex; align-items: center;">短信验证码</view>
			<view style="border-bottom: 1rpx solid #F1F1F1;padding: 20rpx 0; margin-right: 20rpx; flex:1;">
				<form><input v-model="code" type="phone" maxlength="11" onkeyup="this.value=this.value.replace(/\D/g,'')" placeholder="请输入短信验证码" /></form>
			</view>
			<view class="code-view" @click="sendcode()">{{ codeText }}</view>
		</view>
		<view style="width: 100%; height: 20rpx;background: #F1F1F1;margin: 20rpx 0pt;"></view>
		<view class="row-css" style="padding-left: 20rpx;">
			<view class="column-css" style="width: 8rpx;background: #2979ff;margin: 5rpx 10rpx;"></view>
			<view style="font-weight: bold;">请上传本人有效身份证 (必填)</view>
		</view>
		
		<view class="column-css" style="margin: 0 30rpx;color: #5f6579">
			<!-- <view>上传身份证与驾驶证</view> -->
			<view class="row-css" style="font-size: 24rpx;color: #333333;">
				<view class="column-css" style="padding-top: 25rpx;text-align: center;">
					<image
						style="width: 340rpx;height: 230rpx;"
						mode="aspectFit"
						id="idcard1"
						:src="driverreg.idcard1 == '' ? modeimage01 : driverreg.idcard1"
						@tap="chooseImage(1)"
					></image>
					<view style="padding-top: 15rpx;">身份证人像面</view>
				</view>
				<view class="column-css" style="padding-top: 25rpx;text-align: center;margin-left:20rpx;">
					<image
						style="width: 340rpx;height: 230rpx;"
						mode="aspectFit"
						id="idcard2"
						:src="driverreg.idcard2 == '' ? modeimage02 : driverreg.idcard2"
						@tap="chooseImage(2)"
					></image>
					<view style="padding-top: 15rpx;">身份证国徽面</view>
				</view>
			</view>
		</view>
		<view style="width: 100%; height: 20rpx;background: #F1F1F1;margin: 20rpx 0pt;"></view>
		<view style="font-weight: bold;padding-left: 30rpx;">请确定司机信息</view>
		<view class="column-css view-cente">
			<view class="row-css view-cente-cle">
				<view class="view-cente-cle-text">司机姓名</view>
				<input style="z-index: 1;flex: 1;" 
				v-model="driverreg.driverName" 
				:disabled="driverreg.idcard1 ? false : true"
				:placeholder="driverreg.idcard1 ? '证件识别错误，请手动填写' : '请上传身份证,系统自动识别'"
				value="" />
			</view>
		</view>
		<view class="column-css view-cente">
			<view class="row-css view-cente-cle">
				<view class="view-cente-cle-text">身份证号</view>
				<input
					style="z-index: 1;flex: 1;"
					v-model="driverreg.idcard"
					:disabled="driverreg.idcard1 ? false : true"
					:placeholder="driverreg.idcard1 ? '证件识别错误，请手动填写' : '请上传身份证,系统自动识别'"
					value=""
				/>
			</view>
		</view>
		<view style="width: 100%; height: 20rpx;background: #F1F1F1;margin: 20rpx 0pt;"></view>
		<view class="row-css" style="padding-left: 20rpx;">
			<view class="column-css" style="width: 8rpx;background: #2979ff;margin: 5rpx 10rpx;"></view>
			<view style="font-weight: bold;">请上传本人有效驾驶证 (必填)</view>
		</view>
		<view class="desc-css">支持上传电子驾驶证</view>
		<view class="column-css" style="margin: 0 30rpx;color: #5f6579">
			<!-- <view>上传身份证与驾驶证</view> -->
			<view class="row-css" style="font-size: 24rpx;color: #333333;">
				<view class="column-css" style="padding-top: 25rpx;text-align: center;">
					<image
						style="width: 340rpx;height: 230rpx;"
						mode="aspectFit"
						id="driverLicense"
						:src="driverreg.driverLicense == '' ? modeimage03 : driverreg.driverLicense"
						@tap="chooseImage(3)"
					></image>
					<view style="padding-top: 15rpx;">驾驶证正页</view>
				</view>
				<view class="column-css" style="padding-top: 25rpx;text-align: center;margin-left: 20rpx;">
					<image
						style="width: 340rpx;height: 230rpx;"
						mode="aspectFit"
						id="drivingLicenseDeputy"
						:src="driverreg.drivingLicenseDeputy == '' ? modeimage04 : driverreg.drivingLicenseDeputy"
						@tap="chooseImage(4)"
					></image>
					<view style="padding-top: 15rpx;">驾驶证副页</view>
				</view>
			</view>
		</view>
		<view style="width: 100%; height: 20rpx;background: #F1F1F1;margin: 20rpx 0pt;"></view>
		<view class="row-css" style="padding-left: 20rpx;">
			<view class="column-css" style="width: 8rpx;background: #2979ff;margin: 5rpx 10rpx;"></view>
			<view style="font-weight: bold;">请上传本人有效从业资格证</view>
		</view>
		<view class="desc-css">驾驶4.5吨以上车辆请上传从业资格证</view>
		
		<view class="column-css" style="margin: 0 30rpx;color: #5f6579">
			<view class="row-css" style="font-size: 24rpx;color: #333333;">
				<view class="row-css" style="padding-top: 25rpx;text-align: center;">
					<view class="column-css" style="text-align: center;">
						<image style="width: 340rpx;height: 230rpx;" id="tqc" mode="aspectFit" :src="driverreg.tqc == '' ? modeimage05 : driverreg.tqc" @tap="chooseImage(5)"></image>
						<view style="padding-top: 15rpx;">从业资格证正页</view>
					</view>
				</view>
				<view class="row-css" style="padding-top: 25rpx;text-align: center;margin-left: 20rpx;display: none;">
					<view class="column-css" style="text-align: center;">
						<image
							style="width: 340rpx;height: 230rpx;"
							mode="aspectFit"
							id="tqcDeputys"
							:src="driverreg.tqcDeputy == '' ? modeimage : driverreg.tqcDeputy"
							@tap="chooseImage(6)"
						></image>
						<view style="padding-top: 15rpx;">从业资格证副页</view>
					</view>
				</view>
			</view>
		</view>
		<view style="width: 100%; height: 20rpx;background: #F1F1F1;margin: 20rpx 0pt;"></view>
		<!-- <view class="column-css view-cente">
			<view class="row-css view-cente-cle">
				<view class="view-cente-cle-text">身份证有效期</view>
				<input style="z-index: 1;flex: 1;" v-model="driverreg.idcardValidDate" disabled="true" placeholder="请上传身份证,系统自动识别" value="" />
			</view>
		</view>
		<view class="column-css view-cente">
			<view class="row-css view-cente-cle">
				<view class="view-cente-cle-text">驾驶证有效期</view>
				<input style="z-index: 1;flex: 1;" v-model="driverreg.driverLcsValidDate" disabled="true" placeholder="请上传驾驶证,系统自动识别" value="" />
			</view>
		</view>
		<view class="column-css view-cente">
			<view class="row-css view-cente-cle">
				<view class="view-cente-cle-text">推荐人</view>
				<input style="z-index: 1;" v-model="driverreg.reference" placeholder="非必填" value="" />
			</view>
		</view> -->
		<view class="view-button" @click="shake()">去认证</view>
		
		
		
		<uni-popup ref="popup" type="bottom" mask-background-color="rgba(0,0,0,0.8)">
			<view class="popup-wrap">
				<view class="popup-describe">
					<image v-if="index == 1" src="../../static/icon_example_idcard01.png" mode="aspectFit"></image>
					<image v-if="index == 2" src="../../static/icon_example_idcard02.png" mode="aspectFit"></image>
					<image v-if="index == 3" src="../../static/icon_example_driver01.png" mode="aspectFit"></image>
					<image v-if="index == 4" src="../../static/icon_example_driver02.png" mode="aspectFit"></image>
					<image v-if="index == 5" src="../../static/icon_example_bus.png" mode="aspectFit"></image>
					<view>
						<view class="title">{{title}}</view>
						<view class="desc">
							<view>保证证件四角可见，无遮挡，无反光；</view>
							<view>{{desc}}</view>
						</view>
					</view>
				</view>
				<view class="popup-box">
					<view @click="onCamera(0)">拍照</view>
					<view @click="onCamera(1)">从相册选择</view>
				</view>
				<view class="popup-cancel" @click="onCancel">取消</view>
			</view>
		</uni-popup>
		<uni-popup ref="changePhonePop" type="center">
			<view class="unipop__ui_body changePhoneBox">
					<view class="unipop__ui_tit">手机号验证</view>
					<view class="unipop__ui_close" @click="close('changePhonePop')">
						<uni-icons type="closeempty" size="20" color="#aaa"></uni-icons>
					</view>
					<view class="unipop__ui_cnt">
						<view class="cp-tip">
							您正在找回账号并修改登录手机号，请在通过扫脸认证后使用新手机号完成登录。
						</view>
						<view class="cp-tip old-phone">
							原手机号：{{hindMobile(changePhone.mobile)}}
						</view>
						<view class="cp-tip old-phone">
							当前手机号：{{ isupdata ? newphone : userInfo.mobile}}
						</view>
					</view>
					<view class="unipop__ui_btns" style="flex-direction: column;">
						<button class="reset-button auth-btn" @click="goFaceAuth">前往扫脸认证</button>
					</view>
			</view>
		</uni-popup>
		<uni-popup ref="changePhoneTipsPop" type="center">
			<view class="unipop__ui_body changePhoneBox">
					<view class="unipop__ui_tit">提示</view>
					<view class="unipop__ui_close" @click="close('changePhoneTipsPop')">
						<uni-icons type="closeempty" size="20" color="#aaa"></uni-icons>
					</view>
					<view class="unipop__ui_cnt" style="color: #333;">
						您的身份信息已存在系统账号{{hindMobile(changePhone.mobile)}}中，如有需要请使用原手机号登录并修改登录手机号。
					</view>
					<view class="unipop__ui_btns" style="flex-direction: column;">
						<button class="reset-button auth-btn" @click="backLogin(changePhone.mobile)">退出并使用原手机号登录</button>
						<view style="font-size: 12px;color: #2B7CFF;margin-bottom: 10px;" @click="onBackAccount">如原手机号无法使用，请点击找回账号</view>
					</view>
			</view>
		</uni-popup>
	</view>
</template>

<script>
import debounce from '@/common/debounce.js'
export default {
	data() {
		return {
			modeimage01: '../../static/icon_carmer01.png',
			modeimage02: '../../static/icon_carmer02.png',
			modeimage03: '../../static/icon_carmer03.png',
			modeimage04: '../../static/icon_carmer04.png',
			modeimage05: '../../static/icon_carmer05.png',
			userInfo: {},
			isdriverId: false,
			newphone: '',
			code: '',
			time: 60,
			isupdata: false,
			codeText: '获取验证码',
			driverreg: {
				etpName: '',
				idcard1: '',
				idcard2: '',
				tqc: '',
				drivingLicenseDeputy: '',
				tqcDeputy: '',
				driverLicense: '',
				ipAddress: '',
				macAddress: '',
			},
			etpName:'',
			ipAddress: '',
			macAddress: '',
			idPhotoUp: '',
			idPhotoDown: '',
			carrieritems: [],
			list: [],
			platformCoNo: uni.getStorageSync(this.DATA_KEY.platformCoNo),
			
			timer: null,
			index: null,
			title: '',
			desc: '',
			
			changePhone: {
				mobile: '',
				message: ''
			}
		};
	},
	watch:{
		etpName(newVal, oldVal){
			console.log(oldVal, newVal,333)
			let val = newVal
			let { carrieritems } = this;
			let arr = [];
			for (let i = 0; i < carrieritems.length; i++) {
				if (carrieritems[i].etpName.indexOf(val) !== -1) {
					arr.push(carrieritems[i]);
				}
			}
			if (!val) {
				this.list = [];
			} else {
				this.list = arr;
				let obj = this.list.filter((item) => {
					return val === item.etpName
				})
				if(obj.length){
					console.log(obj,11111111)
					this.select(obj[0])
					this.list = []
					console.log(3333333333)
					// this.driverreg.etpId = obj[0].etpId;
					// this.driverreg.etpName = obj[0].etpName;
				}
			}
		}	
	},
	methods: {
		updatipone() {
			this.isupdata = true;
		},
		livingcertification() {
			let that = this;
			that.wxRequest({
				url: `${that.API}/driverService/getDriverIdCardInfo`,
				method: 'POST',
				title: '加载中...',
				data: {
					driverId: that.userInfo.driverId,
					platformCoNo: that.platformCoNo
				},
				success: res => {
					let accessToken = res.data.data.accessToken; //认证令牌
					uni.setStorageSync(this.DATA_KEY.accessToken, accessToken);
					let taxNumber = res.data.data.taxNumber; //平台税号
					if(that.idPhotoUp == '' || that.idPhotoDown == ''){
						that.idPhotoUp = res.data.data.idcard1Base64;
						that.idPhotoDown = res.data.data.idcard2Base64;
					}
					console.log('==活体认证回调地址==========>', `${that.API}/driverService/isLivingBodyState`);
					that.wxRequestData({
						url: `${that.API2}/api/face/getFaceQRCode?access_token=` + accessToken,
						method: 'POST',
						data: {
							companyTaxNumber: taxNumber,
							realName: that.driverreg.driverName,
							idCard: that.driverreg.idcard,
							idPhotoUp: that.idPhotoUp,
							idPhotoDown: that.idPhotoDown,
							callbackUrl: `${that.API}/driverService/isLivingBodyState`
						},
						success: res => {
							if (res.data.code == 0) {
								let orderNumber = res.data.data.orderNumber;
								uni.setStorageSync(this.DATA_KEY.orderNumber, orderNumber);
								console.log('==活体认证订单号==========>', res.data.data.orderNumber);
								that.wxRequest({
									// url: `${that.API}/driverService/saveFaceVerifyOrderNo`,
									url: `${that.API}/driverService/saveFaceVerifyOrderNumber`,
									method: 'POST',
									data: {
										driverId: uni.getStorageSync(that.DATA_KEY.userInfo).driverId,
										orderNumber: orderNumber,
										// platformCoNo: that.platformCoNo
										platformCoId: uni.getStorageSync(this.DATA_KEY.platformCoNo) == '0001' ? '100001' : '100002'
									},
									success: res => {
										// #ifdef APP-PLUS
										uni.showModal({
											title: '提示',
											content: '是否去进行实名认证?跳转进行实名认证后需要重新打开当前APP!',
											success: function(res) {
												if (res.confirm) {
													console.log('用户点击确定');
													// uni.setStorageSync(that.DATA_KEY.liveFlag, true);
													plus.share.getServices(
														function(res) {
															uni.setStorageSync(that.DATA_KEY.liveFlag, true);
															var sweixin = null;
															console.log(res);
															for (var i = 0; i < res.length; i++) {
																var t = res[i];
																console.log(t);
																if (t.id == 'weixin') {
																	sweixin = t;
																}
															}
															if (sweixin) {
																console.log('dddd=', 'a=' + sweixin + '=b');
																sweixin.launchMiniProgram({
																	// id: 'gh_cec8224b00da',
																	id: 'gh_45eec401ff1c',
																	type: 0, //0-正式版 1.测试版，2，体验版
																	path: 'pages/verify/info/index?id=' + orderNumber
																});
															}
														},
														function(res) {
															console.log(JSON.stringify(res));
														}
													);
												} else if (res.cancel) {
													console.log('用户点击取消');
												}
											}
										});
										// #endif
										
										// #ifdef MP-WEIXIN
										uni.showModal({
											title: '提示',
											content: '是否去进行实名认证?',
											success: function(res) {
												if (res.confirm) {
													console.log('用户点击确定');
													//uni.navigateToMiniProgram  打开另一个小程序
													uni.navigateToMiniProgram({
														// appId: 'wxfd2861dc1c86b3a0',
														appId: 'wxfc1e27e05fdd062b',
														path: 'pages/verify/info/index?id=' + orderNumber,
														envVersion: 'release',
														success(res) {
															uni.setStorageSync(that.DATA_KEY.liveFlag, true);
															console.log('跳转成功');
														},
														fail(res) {
															console.log('跳转失败' + JSON.stringify(res));
														}
													});
												} else if (res.cancel) {
													console.log('用户点击取消');
												}
											}
										});
										// #endif
									}
								});
								
							}
						}
					});
				}
			});
		},
		chooseImage: async function(index) {
			this.index = index
			this.$refs.popup.open()
			if(this.index == 1) {
				this.title = '请上传身份证人像面照片'
				this.desc = '姓名、身份证号码等信息清晰，无涂改'
			} else if(this.index == 2) {
				this.title = '请上传身份证国徽面照片'
				this.desc = '签发机关、有效期等信息清晰，无涂改'
			} else if(this.index == 3) {
				this.title = '请上传本人驾驶证正页照片'
				this.desc = '同时支持电子驾驶证正页照片，文字清晰可辩'
			} else if(this.index == 4) {
				this.title = '请上传本人驾驶证副页照片'
				this.desc = '同时支持电子驾驶证副页照片，文字清晰可辩'
			} else if(this.index == 5) {
				this.title = '请上传本人从业资格证照片'
				this.desc = '姓名、证件号码、有效期等信息清晰，无涂改'
			}
			return
			// TODO 选择相机或相册时 需要弹出actionsheet，目前无法获得是相机还是相册，在失败回调中处理
			uni.chooseImage({
				count: 1,
				sizeType: 'compressed',
				success: res => {
					console.log('ddd======1------------>', res.tempFiles);
					console.log('ddd======2------------>', res.tempFiles[0]);
					console.log('ddd======3------------>', res.tempFiles[0].size);
					let resSize = res.tempFiles[0].size;
					if (resSize > 10485760) {
						uni.showToast({
							title: '上传的图片大小不超过10M,请重新上传！',
							icon: 'none',
							duration: 2000,
							mask: true
						});
						return;
					}
					uni.showLoading({
						title: '上传中'
					});
					if (index == 1) {
						uni.uploadFile({
							url: `${this.API}/driverService/uploadIdcard`,
							fileType: 'image',
							name: 'file',
							filePath: res.tempFilePaths[0],
							file: res.tempFiles,
							header: {
								'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
								Authorization: uni.getStorageSync(this.DATA_KEY.token)
							},
							formData: {
								fileType: '2',
								mobile: this.userInfo.mobile,
								fileId: Math.floor(Math.random() * 1259),
								ocrOrNot: '1',
								orderId: ''
							},
							success: res => {
								console.log('身份证正面: ', JSON.parse(res.data));
								uni.hideLoading();
								if (JSON.parse(res.data).code == 0) {
									this.driverreg.idcard1 = JSON.parse(res.data).data.imgurl;
									this.idPhotoUp = JSON.parse(res.data).data.idCardBase64;
									// this.driverreg._driverName = JSON.parse(res.data).data.name;
									this.driverreg.driverName = JSON.parse(res.data).data.name;
									// this.driverreg._idcard = JSON.parse(res.data).data.id;
									this.driverreg.idcard = JSON.parse(res.data).data.id;
									this.driverreg.driverNameOcrIdcard = JSON.parse(res.data).data.name;
									this.driverreg.idOcrIdcard = JSON.parse(res.data).data.id;
									this.driverreg.uploadIdCardFlag = JSON.parse(res.data).data.uploadIdCardFlag;
									this.driverreg.uploadIdCardMsg = JSON.parse(res.data).data.uploadIdCardMsg;
								} else {
									uni.showToast({
										title: JSON.parse(res.data).msg,
										icon: 'none'
									});
								}
							},
							fail: error => {
								uni.showToast({
									title: '文件上传失败',
									icon: 'none'
								});
							}
						});
					} else if (index == 2) {
						uni.uploadFile({
							url: `${this.API}/driverService/uploadIdcardBack`, //仅为示例，非真实的接口地址
							fileType: 'image',
							name: 'file',
							filePath: res.tempFilePaths[0],
							file: res.tempFiles,
							header: {
								'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
								Authorization: uni.getStorageSync(this.DATA_KEY.token)
							},
							formData: {
								fileType: '3',
								mobile: this.userInfo.mobile,
								fileId: Math.floor(Math.random() * 1259),
								ocrOrNot: '1',
								orderId: ''
							},
							success: res => {
								console.log('身份证国徽面: ', JSON.parse(res.data));
								uni.hideLoading();
								if (JSON.parse(res.data).code == 0) {
									this.driverreg.idcard2 = JSON.parse(res.data).data.imgurl;
									this.idPhotoDown = JSON.parse(res.data).data.idCardBackBase64;
									// if (JSON.parse(res.data).data.start_date != '' && JSON.parse(res.data).data.valid_date != '') {
										console.log(this.fordata(JSON.parse(res.data).data.start_date))
										this.driverreg.idcardValidDate = this.fordata(JSON.parse(res.data).data.start_date)+ '-' + this.fordata(JSON.parse(res.data).data.valid_date);
										this.driverreg.idcardStartDate = this.fordata(JSON.parse(res.data).data.start_date);
										this.driverreg.idcardEndDate = this.fordata(JSON.parse(res.data).data.valid_date);
										this.driverreg.manualIdcardStartTime = this.fordata(JSON.parse(res.data).data.start_date);
										this.driverreg.manualIdcardEndTime = this.fordata(JSON.parse(res.data).data.valid_date);
									// }
									this.driverreg.uploadIdCardBackFlag = JSON.parse(res.data).data.uploadIdCardBackFlag;
									this.driverreg.uploadIdCardBackMsg = JSON.parse(res.data).data.uploadIdCardBackMsg;
								} else {
									uni.showToast({
										title: JSON.parse(res.data).msg,
										icon: 'none'
									});
								}
							},
							fail: error => {
								uni.showToast({
									title: '文件上传失败',
									icon: 'none'
								});
							}
						});
					} else if (index == 3) {
						uni.uploadFile({
							// url: `${this.API}/driverService/upload_driving`, //仅为示例，非真实的接口地址
							url: `${this.API}/driverService/newUploadDriving`, //仅为示例，非真实的接口地址
							fileType: 'image',
							name: 'file',
							filePath: res.tempFilePaths[0],
							file: res.tempFiles,
							header: {
								'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
								Authorization: uni.getStorageSync(this.DATA_KEY.token)
							},
							formData: {
								fileType: '4',
								mobile: this.userInfo.mobile,
								fileId: Math.floor(Math.random() * 1259),
								ocrOrNot: '1',
								orderId: ''
							},
							success: res => {
								console.log('驾驶证正面: ', JSON.parse(res.data));
								uni.hideLoading();
								if (JSON.parse(res.data).code == 0) {
									this.driverreg.driverLicense = JSON.parse(res.data).data.imgurl;
									// if (JSON.parse(res.data).data.start_date != '' && JSON.parse(res.data).data.date != '') {
										this.driverreg.driverStartDate = this.fordata(JSON.parse(res.data).data.driverStartDate);
										this.driverreg.driverEndDate = this.fordata(JSON.parse(res.data).data.driverEndDate);
										this.driverreg.driverNameOcrDriverLicense = JSON.parse(res.data).data.driverNameOcrDriverLicense;
										this.driverreg.driverLcsValidDate = this.fordata(JSON.parse(res.data).data.driverStartDate) + '-' + this.fordata(JSON.parse(res.data).data.driverEndDate);
										this.driverreg.idOcrDriverLicense = JSON.parse(res.data).data.idOcrDriverLicense;
										this.driverreg.driverModel = JSON.parse(res.data).data.driverModel;
										if(JSON.parse(res.data).data.issuingOrganizations){
											this.driverreg.issuingOrganizations = JSON.parse(res.data).data.issuingOrganizations;
										}
										this.driverreg.manualDriveStartTime = this.fordata(JSON.parse(res.data).data.driverStartDate);
										this.driverreg.manualDriveEndTime = this.fordata(JSON.parse(res.data).data.driverEndDate);
									// }
									this.driverreg.uploadDrivingFlag = JSON.parse(res.data).data.uploadDrivingFlag;
									this.driverreg.uploadDrivingMsg = JSON.parse(res.data).data.uploadDrivingMsg;
								} else {
									uni.showToast({
										title: JSON.parse(res.data).msg,
										icon: 'none'
									});
								}
							},
							fail: error => {
								uni.showToast({
									title: '文件上传失败',
									icon: 'none'
								});
							}
						});
					} else if (index == 4) {
						uni.uploadFile({
							url: `${this.API}/driverService/uploadDrivingBack`,
							fileType: 'image',
							name: 'file',
							filePath: res.tempFilePaths[0],
							file: res.tempFiles,
							header: {
								// 'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
								Authorization: uni.getStorageSync(this.DATA_KEY.token)
							},
							formData: {
								fileType: '2',
								mobile: this.userInfo.mobile,
								fileId: Math.floor(Math.random() * 1259),
								ocrOrNot: '1',
								orderId: ''
							},
							success: res => {
								console.log('驾驶证副页: ', JSON.parse(res.data));
								let data = JSON.parse(res.data)
								uni.hideLoading();
								if (JSON.parse(res.data).code == 0) {
									this.driverreg.drivingLicenseDeputy = JSON.parse(res.data).data.imgUrl;
									// console.log(this.driverreg.issuingOrganizations)
									if(!this.driverreg.issuingOrganizations) {
										this.driverreg.issuingOrganizations = JSON.parse(res.data).data.issuingOrganizations;
										console.log(this.driverreg.issuingOrganizations)
									}
									this.$forceUpdate();
								} else {
									uni.showToast({
										title: JSON.parse(res.data).msg,
										icon: 'none'
									});
								}
							},
							fail: error => {
								uni.showToast({
									title: '文件上传失败',
									icon: 'none'
								});
							}
						});
					} else if (index == 5) {
						uni.uploadFile({
							url: `${this.API}/driverService/uploadTqc`,
							fileType: 'image',
							name: 'file',
							filePath: res.tempFilePaths[0],
							file: res.tempFiles,
							header: {
								// 'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
								Authorization: uni.getStorageSync(this.DATA_KEY.token)
							},
							formData: {
								fileType: '2',
								mobile: this.userInfo.mobile,
								fileId: Math.floor(Math.random() * 1259),
								ocrOrNot: '1',
								orderId: ''
							},
							success: res => {
								uni.hideLoading();

								if (JSON.parse(res.data).code == 0) {
									this.driverreg.tqc = JSON.parse(res.data).data.imgurl;
									this.driverreg.tqcNo = JSON.parse(res.data).data.tqcNo;
									this.$forceUpdate();
								} else {
									uni.showToast({
										title: JSON.parse(res.data).msg,
										icon: 'none'
									});
								}
							},
							fail: error => {
								uni.showToast({
									title: '文件上传失败',
									icon: 'none'
								});
							}
						});
					} else if (index == 6) {
						uni.uploadFile({
							url: `${this.API}/driverService/upload`,
							fileType: 'image',
							name: 'file',
							filePath: res.tempFilePaths[0],
							file: res.tempFiles,
							header: {
								// 'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
								Authorization: uni.getStorageSync(this.DATA_KEY.token)
							},
							formData: {
								fileType: '2',
								mobile: this.userInfo.mobile,
								fileId: Math.floor(Math.random() * 1259),
								ocrOrNot: '1',
								orderId: ''
							},
							success: res => {
								console.log('从业资格证反面: ', JSON.parse(res.data));
								uni.hideLoading();

								if (JSON.parse(res.data).code == 0) {
									this.driverreg.tqcDeputy = JSON.parse(res.data).data;
									this.$forceUpdate();
								} else {
									uni.showToast({
										title: JSON.parse(res.data).msg,
										icon: 'none'
									});
								}
							},
							fail: error => {
								uni.showToast({
									title: '文件上传失败',
									icon: 'none'
								});
							}
						});
					}
				}
				// fail: err => {
				// 	uni.getSetting({
				// 		success: res => {
				// 			let authStatus = false;
				// 			switch (this.sourceTypeIndex) {
				// 				case 0:
				// 					authStatus = res.authSetting['scope.camera'];
				// 					break;
				// 				case 1:
				// 					authStatus = res.authSetting['scope.album'];
				// 					break;
				// 				case 2:
				// 					authStatus = res.authSetting['scope.album'] && res.authSetting['scope.camera'];
				// 					break;
				// 				default:
				// 					break;
				// 			}
				// 			if (!authStatus) {
				// 				uni.showModal({
				// 					title: '授权失败',
				// 					content: '认证需要从您的相机或相册获取图片，请在设置界面打开相关权限',
				// 					success: res => {
				// 						if (res.confirm) {
				// 							uni.openSetting();
				// 						}
				// 					}
				// 				});
				// 			}
				// 		}
				// 	});
				// }
			});
		},
		onCancel(){
			this.$refs.popup.close()
		},
		onCamera(num) {
			let sourceType
			num === 0 ? sourceType = ['camera'] : sourceType = ['album'] 
			let index = this.index
			this.$refs.popup.close()
			uni.chooseImage({
				count: 1,
				sourceType: sourceType,
				sizeType: 'compressed',
				success: res => {
					console.log('ddd======1------------>', res.tempFiles);
					console.log('ddd======2------------>', res.tempFiles[0]);
					console.log('ddd======3------------>', res.tempFiles[0].size);
					let resSize = res.tempFiles[0].size;
					if (resSize > 10485760) {
						uni.showToast({
							title: '上传的图片大小不超过10M,请重新上传！',
							icon: 'none',
							duration: 2000,
							mask: true
						});
						return;
					}
					uni.showLoading({
						title: '上传中'
					});
					if (index == 1) {
						uni.uploadFile({
							url: `${this.API}/driverService/uploadIdcard`,
							fileType: 'image',
							name: 'file',
							filePath: res.tempFilePaths[0],
							file: res.tempFiles,
							header: {
								'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
								Authorization: uni.getStorageSync(this.DATA_KEY.token)
							},
							formData: {
								fileType: '2',
								mobile: this.userInfo.mobile,
								fileId: Math.floor(Math.random() * 1259),
								ocrOrNot: '1',
								orderId: ''
							},
							success: res => {
								console.log('身份证正面: ', JSON.parse(res.data));
								uni.hideLoading();
								if (JSON.parse(res.data).code == 0) {
									this.driverreg.idcard1 = JSON.parse(res.data).data.imgurl;
									this.idPhotoUp = JSON.parse(res.data).data.idCardBase64;
									// this.driverreg._driverName = JSON.parse(res.data).data.name;
									this.driverreg.driverName = JSON.parse(res.data).data.name;
									// this.driverreg._idcard = JSON.parse(res.data).data.id;
									this.driverreg.idcard = JSON.parse(res.data).data.id;
									this.driverreg.driverNameOcrIdcard = JSON.parse(res.data).data.name;
									this.driverreg.idOcrIdcard = JSON.parse(res.data).data.id;
									this.driverreg.uploadIdCardFlag = JSON.parse(res.data).data.uploadIdCardFlag;
									this.driverreg.uploadIdCardMsg = JSON.parse(res.data).data.uploadIdCardMsg;
								} else {
									uni.showToast({
										title: JSON.parse(res.data).msg,
										icon: 'none'
									});
								}
							},
							fail: error => {
								uni.showToast({
									title: '文件上传失败',
									icon: 'none'
								});
							}
						});
					} else if (index == 2) {
						uni.uploadFile({
							url: `${this.API}/driverService/uploadIdcardBack`, //仅为示例，非真实的接口地址
							fileType: 'image',
							name: 'file',
							filePath: res.tempFilePaths[0],
							file: res.tempFiles,
							header: {
								'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
								Authorization: uni.getStorageSync(this.DATA_KEY.token)
							},
							formData: {
								fileType: '3',
								mobile: this.userInfo.mobile,
								fileId: Math.floor(Math.random() * 1259),
								ocrOrNot: '1',
								orderId: ''
							},
							success: res => {
								console.log('身份证国徽面: ', JSON.parse(res.data));
								uni.hideLoading();
								if (JSON.parse(res.data).code == 0) {
									this.driverreg.idcard2 = JSON.parse(res.data).data.imgurl;
									this.idPhotoDown = JSON.parse(res.data).data.idCardBackBase64;
									// if (JSON.parse(res.data).data.start_date != '' && JSON.parse(res.data).data.valid_date != '') {
										console.log(this.fordata(JSON.parse(res.data).data.start_date))
										this.driverreg.idcardValidDate = this.fordata(JSON.parse(res.data).data.start_date)+ '-' + this.fordata(JSON.parse(res.data).data.valid_date);
										this.driverreg.idcardStartDate = this.fordata(JSON.parse(res.data).data.start_date);
										this.driverreg.idcardEndDate = this.fordata(JSON.parse(res.data).data.valid_date);
										this.driverreg.manualIdcardStartTime = this.fordata(JSON.parse(res.data).data.start_date);
										this.driverreg.manualIdcardEndTime = this.fordata(JSON.parse(res.data).data.valid_date);
									// }
									this.driverreg.uploadIdCardBackFlag = JSON.parse(res.data).data.uploadIdCardBackFlag;
									this.driverreg.uploadIdCardBackMsg = JSON.parse(res.data).data.uploadIdCardBackMsg;
								} else {
									uni.showToast({
										title: JSON.parse(res.data).msg,
										icon: 'none'
									});
								}
							},
							fail: error => {
								uni.showToast({
									title: '文件上传失败',
									icon: 'none'
								});
							}
						});
					} else if (index == 3) {
						uni.uploadFile({
							// url: `${this.API}/driverService/upload_driving`, //仅为示例，非真实的接口地址
							url: `${this.API}/driverService/newUploadDriving`, //仅为示例，非真实的接口地址
							fileType: 'image',
							name: 'file',
							filePath: res.tempFilePaths[0],
							file: res.tempFiles,
							header: {
								'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
								Authorization: uni.getStorageSync(this.DATA_KEY.token)
							},
							formData: {
								fileType: '4',
								mobile: this.userInfo.mobile,
								fileId: Math.floor(Math.random() * 1259),
								ocrOrNot: '1',
								orderId: ''
							},
							success: res => {
								console.log('驾驶证正面: ', JSON.parse(res.data));
								uni.hideLoading();
								if (JSON.parse(res.data).code == 0) {
									this.driverreg.driverLicense = JSON.parse(res.data).data.imgurl;
									// if (JSON.parse(res.data).data.start_date != '' && JSON.parse(res.data).data.date != '') {
										this.driverreg.driverStartDate = this.fordata(JSON.parse(res.data).data.driverStartDate);
										this.driverreg.driverEndDate = this.fordata(JSON.parse(res.data).data.driverEndDate);
										this.driverreg.driverNameOcrDriverLicense = JSON.parse(res.data).data.driverNameOcrDriverLicense;
										this.driverreg.driverLcsValidDate = this.fordata(JSON.parse(res.data).data.driverStartDate) + '-' + this.fordata(JSON.parse(res.data).data.driverEndDate);
										this.driverreg.idOcrDriverLicense = JSON.parse(res.data).data.idOcrDriverLicense;
										this.driverreg.driverModel = JSON.parse(res.data).data.driverModel;
										if(JSON.parse(res.data).data.issuingOrganizations){
											this.driverreg.issuingOrganizations = JSON.parse(res.data).data.issuingOrganizations;
										}
										this.driverreg.manualDriveStartTime = this.fordata(JSON.parse(res.data).data.driverStartDate);
										this.driverreg.manualDriveEndTime = this.fordata(JSON.parse(res.data).data.driverEndDate);
									// }
									this.driverreg.uploadDrivingFlag = JSON.parse(res.data).data.uploadDrivingFlag;
									this.driverreg.uploadDrivingMsg = JSON.parse(res.data).data.uploadDrivingMsg;
								} else {
									uni.showToast({
										title: JSON.parse(res.data).msg,
										icon: 'none'
									});
								}
							},
							fail: error => {
								uni.showToast({
									title: '文件上传失败',
									icon: 'none'
								});
							}
						});
					} else if (index == 4) {
						uni.uploadFile({
							url: `${this.API}/driverService/uploadDrivingBack`,
							fileType: 'image',
							name: 'file',
							filePath: res.tempFilePaths[0],
							file: res.tempFiles,
							header: {
								// 'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
								Authorization: uni.getStorageSync(this.DATA_KEY.token)
							},
							formData: {
								fileType: '2',
								mobile: this.userInfo.mobile,
								fileId: Math.floor(Math.random() * 1259),
								ocrOrNot: '1',
								orderId: ''
							},
							success: res => {
								console.log('驾驶证副页: ', JSON.parse(res.data));
								let data = JSON.parse(res.data)
								uni.hideLoading();
								if (JSON.parse(res.data).code == 0) {
									this.driverreg.drivingLicenseDeputy = JSON.parse(res.data).data.imgUrl;
									// console.log(this.driverreg.issuingOrganizations)
									if(!this.driverreg.issuingOrganizations) {
										this.driverreg.issuingOrganizations = JSON.parse(res.data).data.issuingOrganizations;
										console.log(this.driverreg.issuingOrganizations)
									}
									this.$forceUpdate();
								} else {
									uni.showToast({
										title: JSON.parse(res.data).msg,
										icon: 'none'
									});
								}
							},
							fail: error => {
								uni.showToast({
									title: '文件上传失败',
									icon: 'none'
								});
							}
						});
					} else if (index == 5) {
						uni.uploadFile({
							url: `${this.API}/driverService/uploadTqc`,
							fileType: 'image',
							name: 'file',
							filePath: res.tempFilePaths[0],
							file: res.tempFiles,
							header: {
								// 'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
								Authorization: uni.getStorageSync(this.DATA_KEY.token)
							},
							formData: {
								fileType: '2',
								mobile: this.userInfo.mobile,
								fileId: Math.floor(Math.random() * 1259),
								ocrOrNot: '1',
								orderId: ''
							},
							success: res => {
								uni.hideLoading();
				
								if (JSON.parse(res.data).code == 0) {
									this.driverreg.tqc = JSON.parse(res.data).data.imgurl;
									this.driverreg.tqcNo = JSON.parse(res.data).data.tqcNo;
									this.$forceUpdate();
								} else {
									uni.showToast({
										title: JSON.parse(res.data).msg,
										icon: 'none'
									});
								}
							},
							fail: error => {
								uni.showToast({
									title: '文件上传失败',
									icon: 'none'
								});
							}
						});
					} else if (index == 6) {
						uni.uploadFile({
							url: `${this.API}/driverService/upload`,
							fileType: 'image',
							name: 'file',
							filePath: res.tempFilePaths[0],
							file: res.tempFiles,
							header: {
								// 'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
								Authorization: uni.getStorageSync(this.DATA_KEY.token)
							},
							formData: {
								fileType: '2',
								mobile: this.userInfo.mobile,
								fileId: Math.floor(Math.random() * 1259),
								ocrOrNot: '1',
								orderId: ''
							},
							success: res => {
								console.log('从业资格证反面: ', JSON.parse(res.data));
								uni.hideLoading();
				
								if (JSON.parse(res.data).code == 0) {
									this.driverreg.tqcDeputy = JSON.parse(res.data).data;
									this.$forceUpdate();
								} else {
									uni.showToast({
										title: JSON.parse(res.data).msg,
										icon: 'none'
									});
								}
							},
							fail: error => {
								uni.showToast({
									title: '文件上传失败',
									icon: 'none'
								});
							}
						});
					}
				},
				fail: (err) => {
					console.log(err)
				}
			})
		},
		search(e) {
			let val = e.detail.value.trim();
			// if (val.length > 2) {
				console.log(val)
			let { carrieritems } = this;
			let arr = [];
			for (let i = 0; i < carrieritems.length; i++) {
				if (carrieritems[i].etpName.indexOf(val) !== -1) {
					arr.push(carrieritems[i]);
				}
			}
			if (!val) {
				this.list = [];
			} else {
				this.list = arr;
				let obj = this.list.filter((item) => {
					return val === item.etpName
				})
				if(obj.length){
					console.log(obj,11111111)
					this.select(obj[0])
					this.list = [];
					// this.driverreg.etpId = obj[0].etpId;
					// this.driverreg.etpName = obj[0].etpName;
				}
			}
		},
		select(item) {
			this.driverreg.etpId = item.etpId;
			this.driverreg.etpName = item.etpName;
			console.log(this.driverreg.etpName)
			this.etpName = item.etpName;
			this.list = [];
			console.log(this.list,'11111111112')
		},
		sendcode() {
			var reg = 11 && /^((13|14|15|16|17|18|19)[0-9]{1}\d{8})$/;
			if (this.newphone == '' && this.newphone != null) {
				uni.showToast({
					title: '请输入手机号码',
					icon: 'none'
				});
			} else if (!reg.test(this.newphone)) {
				uni.showToast({
					title: '手机格式不正确',
					icon: 'none'
				});
			} else {
				if (this.time == 60) {
					this.timer = setInterval(() => {
						this.codeText = `${this.time}s后获取验证码`;
						this.time--;
						if (this.time < 0) {
							this.time = 60;
							this.codeText = '获取验证码';
							clearInterval(this.timer);
						}
					}, 1000);
					this.wxRequest({
						url: `${this.API}/miniApp/auth/sms-code?tel=` + this.newphone,
						method: 'POST',
						title: '验证码发送中...',
						success: res => {
							if (res.data.code == 200) {
								uni.showToast({
									title: '验证码已发送成功',
									icon: 'none'
								});
							}
						}
					});
				}
			}
		},
		onSubscribeMessage() {
			uni.getSetting({
				withSubscriptions: true,
				success(res) {
					if (res.subscriptionsSetting.mainSwitch == true) {
						console.log('1=2===========>', res);
						if (res.subscriptionsSetting.itemSettings != null) {
							//是否总是记住
							if (res.subscriptionsSetting.itemSettings['1XVivLfWx3FXmj1GIuQP0dI31xOTQkGoTqUoB1XqcKY'] != 'accept') {
								//是否允许（否）
								uni.showModal({
									title: '"司机小程序"需要您授权接收订阅通知！',
									// content: '请点击设置->打开位置信息->使用小程序期间和离开小程序后',
									confirmText: '去设置',
									showCancel: false,
									success(res) {
										if (res.confirm) {
											uni.openSetting({
												success(res) {}
											});
										}
									}
								});
							}
						} else {
							uni.requestSubscribeMessage({
								tmplIds: ['1XVivLfWx3FXmj1GIuQP0dI31xOTQkGoTqUoB1XqcKY'],
								success(res) {
									console.log('1============>', res);
									// uni.setStorageSync(this.DATA_KEY.issubscription, idPhotoUp);
								}
							});
						}
					} else {
						uni.showModal({
							title: '"司机小程序"需要您授权接收订阅消息！',
							// content: '请点击设置->打开位置信息->使用小程序期间和离开小程序后',
							confirmText: '去设置',
							showCancel: false,
							success(res) {
								if (res.confirm) {
									uni.openSetting({
										success(res) {}
									});
								}
							}
						});
					}
				}
			});
		},
		
		shake() {
		    if (this.timer) {
		        clearTimeout(this.timer)
		    }
		    this.timer = setTimeout(() => {
				console.log(888888)
		        this.onnext()
		    }, 1000)
		},
		
		onnext() {
			// this.driverreg.driverNameOcrIdcard = this.driverreg.driverName;
			// this.driverreg.idOcrIdcard = this.driverreg.idcard;
			this.driverreg.ipAddress = this.ipAddress;
			this.driverreg.macAddress = this.macAddress;
			if(!this.driverreg.ipAddress){
				this.wxRequest({
					// 获取ip
					url: `${this.API}/driverService/getIp`,
					success(res) {
						this.driverreg.ipAddress = res.data.data.ip
					}
				});
			}
			if (
				this.driverreg.driverName != '' &&
				this.driverreg.idcard1 != '' &&
				this.driverreg.idcard2 != '' &&
				this.driverreg.driverLicense != '' &&
				this.driverreg.drivingLicenseDeputy != ''
			) {
				// #ifdef MP-WEIXIN
				this.driverreg.signChannel = 4;
				// #endif
				// #ifdef APP-PLUS
				this.driverreg.signChannel = 1;
				// #endif

				this.driverreg.driverId = this.userInfo.driverId;
				// if (this.isupdata) {
				// 	this.wxRequest({
				// 		url: `${this.API}/driverService/updateDriverMobile?driver_id=` + this.userInfo.driverId + '&mobile=' + this.newphone + '&code=' + this.code,
				// 		method: 'POST',
				// 		success: res => {
				// 			this.driverreg.mobile = this.newphone;
				// 			if (this.isdriverId) {
				// 				this.wxRequest({
				// 					url: `${this.API}/driverService/driverSubmit`,
				// 					method: 'POST',
				// 					data: this.driverreg,
				// 					title: '提交中...',
				// 					success: res => {
				// 						uni.setStorageSync(this.DATA_KEY.etpId, this.driverreg.etpId);
				// 						uni.setStorageSync(this.DATA_KEY.etpName, this.driverreg.etpName);

				// 						// #ifdef MP-WEIXIN
				// 						this.onSubscribeMessage();
				// 						// #endif
				// 						uni.redirectTo({
				// 							url: '../personal/review?iscar=' + true
				// 						});
				// 					}
				// 				});
				// 			} else {
				// 				this.wxRequest({
				// 					url: `${this.API}/driverService/driverRegister`,
				// 					method: 'POST',
				// 					data: this.driverreg,
				// 					title: '提交中...',
				// 					success: res => {
				// 						uni.setStorageSync(this.DATA_KEY.etpId, this.driverreg.etpId);
				// 						uni.setStorageSync(this.DATA_KEY.etpName, this.driverreg.etpName);
				// 						// #ifdef MP-WEIXIN
				// 						this.onSubscribeMessage();
				// 						// #endif
				// 						uni.redirectTo({
				// 							url: '../personal/review?iscar=' + true
				// 						});
				// 					}
				// 				});
				// 			}
				// 		}
				// 	});
				// } else {
				this.driverreg.mobile = uni.getStorageSync(this.DATA_KEY.userInfo).mobile;
				// this.driverreg.mobileInCar = uni.getStorageSync(this.DATA_KEY.userInfo).mobile;
				let that = this;
				that.wxRequest({
					url: `${that.API}/driverService/checkIdCardUnique`,
					method: 'POST',
					title: '校验中...',
					data: {
						driverId: uni.getStorageSync(that.DATA_KEY.userInfo).driverId,
						idcard: that.driverreg.idcard
					},
					success: res => {
						if (res.data.data.status != 0) {
							if (res.data.data.mobile && res.data.data.status == 1) {
								this.$refs['changePhoneTipsPop'].open();
								this.changePhone.essage = res.data.data.message;
								this.changePhone.mobile = res.data.data.mobile
							} else {
								uni.showModal({
									title: '提示',
									content: res.data.data.message,
									showCancel:false,
									confirmText: '确认',
									success: function(res) {
										// if (res.confirm) {
										// 	// if (that.isdriverId) {
										// 	// 	that.wxRequest({
										// 	// 		url: `${that.API}/driverService/driverSubmit`,
										// 	// 		method: 'POST',
										// 	// 		data: that.driverreg,
										// 	// 		title: '提交中...',
										// 	// 		success: res => {
										// 	// 			uni.setStorageSync(that.DATA_KEY.etpId, that.driverreg.etpId);
										// 	// 			uni.setStorageSync(that.DATA_KEY.etpName, that.driverreg.etpName);
										// 	// 			// #ifdef MP-WEIXIN
										// 	// 			that.onSubscribeMessage();
										// 	// 			// #endif
										// 	// 			uni.redirectTo({
										// 	// 				url: '../personal/review?iscar=' + true
										// 	// 			});
										// 	// 		}
										// 	// 	});
										// 	// } else {
										// 	that.wxRequest({
										// 		url: `${that.API}/driverService/driverRegister`,
										// 		method: 'POST',
										// 		data: that.driverreg,
										// 		title: '提交中...',
										// 		success: res => {
										// 			uni.setStorageSync(that.DATA_KEY.etpId, that.driverreg.etpId);
										// 			uni.setStorageSync(that.DATA_KEY.etpName, that.driverreg.etpName);
										// 			that.livingcertification();
										// 			// #ifdef MP-WEIXIN
										// 			that.onSubscribeMessage();
										// 			// #endif
										// 			uni.redirectTo({
										// 				url: '../personal/review?iscar=' + true
										// 			});
										// 		}
										// 	});
										// 	// }
										// } else if (res.cancel) {
										// 	uni.setStorageSync(that.DATA_KEY.userInfo, '');
										// 	uni.setStorageSync(that.DATA_KEY.token, '');
										// 	uni.setStorageSync(that.DATA_KEY.etpId, '');
										// 	uni.setStorageSync(that.DATA_KEY.etpName, '');
										// 	uni.setStorageSync(that.DATA_KEY.oldTime, '');
										// 	uni.setStorageSync(that.DATA_KEY.loadingOrderId, '');
										// 	// #ifdef MP-WEIXIN
										// 	uni.redirectTo({
										// 		url: '../personal/quicklogin'
										// 	});
										// 	// #endif
										// 	// #ifdef APP-PLUS
										// 	uni.redirectTo({
										// 		url: '../personal/login'
										// 	});
										// 	// #endif
										// }
									}
								});
							}
						} else {
							console.log(Date.parse(that.driverreg.idcardEndDate) < new Date().getTime())
							console.log(Date.parse(that.driverreg.driverEndDate) < new Date().getTime())
							if(that.driverreg.driverName != that.driverreg.driverNameOcrIdcard){
								this.driverreg.uploadIdCardFlag = 1;
								this.driverreg.uploadIdCardMsg = '真实姓名和身份证证件不一致';
								uni.showModal({
									content: '您提交的真实姓名和身份证证件不一致，请重新修改后再提交',
									cancelText: '去申诉',
									cancelColor: '#999999',
									success: function (res) {
										if (res.confirm) {
											return
										} else if (res.cancel) {
											that._submit(1)
										}
									}		
								})
							}else if(that.driverreg.driverName != that.driverreg.driverNameOcrDriverLicense){
								console.log(that.driverreg.driverName)
								console.log(that.driverreg.driverNameOcrDriverLicense)
								this.driverreg.uploadDrivingFlag = 1;
								this.driverreg.uploadDrivingMsg = '真实姓名和驾驶证证件不一致';
								uni.showModal({
									content: '您提交的真实姓名和驾驶证证件不一致，请重新修改后再提交',
									cancelText: '去申诉',
									cancelColor: '#999999',
									success: function (res) {
										if (res.confirm) {
											return
										} else if (res.cancel) {
											that._submit(1)
										}
									}		
								})
							}else if(that.driverreg.idcard != that.driverreg.idOcrIdcard){
								this.driverreg.uploadIdCardFlag = 1;
								this.driverreg.uploadIdCardMsg = '输入身份证号和身份证证件不一致';
								uni.showModal({
									content: '您提交的输入身份证号和身份证证件不一致，请重新修改后再提交',
									cancelText: '去申诉',
									cancelColor: '#999999',
									success: function (res) {
										if (res.confirm) {
											return
										} else if (res.cancel) {
											that._submit(1)
										}
									}		
								})
							}else if(that.driverreg.idcard != that.driverreg.idOcrDriverLicense){
								this.driverreg.uploadDrivingFlag = 1;
								this.driverreg.uploadDrivingMsg = '输入身份证号和和驾驶证证件不一致';
								uni.showModal({
									content: '您提交的输入身份证号和和驾驶证证件不一致，请重新修改后再提交',
									cancelText: '去申诉',
									cancelColor: '#999999',
									success: function (res) {
										if (res.confirm) {
											return
										} else if (res.cancel) {
											that._submit(1)
										}
									}		
								})
							}else if(that.driverreg.uploadIdCardFlag == 1){
								uni.showModal({
									content: '您提交的身份证疑似非有效证件，请重新修改后再提交',
									cancelText: '去申诉',
									cancelColor: '#999999',
									success: function (res) {
										if (res.confirm) {
											return
										} else if (res.cancel) {
											that._submit(1)
										}
									}		
								})
							}else if(that.driverreg.uploadIdCardBackFlag == 1){
								uni.showModal({
									content: '您提交的身份证疑似非有效证件，请重新修改后再提交',
									cancelText: '去申诉',
									cancelColor: '#999999',
									success: function (res) {
										if (res.confirm) {
											return
										} else if (res.cancel) {
											that._submit(1)
										}
									}		
								})
							}else if(that.driverreg.uploadDrivingFlag == 1){
								uni.showModal({
									content: '您提交的驾驶证疑似非有效证件，请重新修改后再提交',
									cancelText: '去申诉',
									cancelColor: '#999999',
									success: function (res) {
										if (res.confirm) {
											return
										} else if (res.cancel) {
											that._submit(1)
										}
									}		
								})
							}else if(!that.driverreg.idcardValidDate){
								this.driverreg.uploadIdCardFlag = 1;
								this.driverreg.uploadIdCardMsg = '身份证疑似非有效证件';
								uni.showModal({
									content: '您提交的身份证疑似非有效证件，请重新修改后再提交',
									cancelText: '去申诉',
									cancelColor: '#999999',
									success: function (res) {
										if (res.confirm) {
											return
										} else if (res.cancel) {
											that._submit(1)
										}
									}		
								})
							}else if(!that.driverreg.driverLcsValidDate){
								this.driverreg.uploadDrivingFlag = 1;
								this.driverreg.uploadDrivingMsg = '驾驶证疑似非有效证件';
								uni.showModal({
									content: '您提交的驾驶证疑似非有效证件，请重新修改后再提交',
									cancelText: '去申诉',
									cancelColor: '#999999',
									success: function (res) {
										if (res.confirm) {
											return
										} else if (res.cancel) {
											that._submit(1)
										}
									}		
								})
							}else if(Date.parse(that.driverreg.idcardEndDate) + 24*60*60*1000 < new Date().getTime()){
								this.driverreg.uploadIdCardFlag = 1;
								this.driverreg.uploadIdCardMsg = '身份证已过期';
								uni.showModal({
									content: '您提交的身份证已过期，请重新修改后再提交',
									cancelText: '去申诉',
									cancelColor: '#999999',
									success: function (res) {
										if (res.confirm) {
											return
										} else if (res.cancel) {
											that._submit(1)
										}
									}		
								})
							}else if(Date.parse(that.driverreg.driverEndDate) + 24*60*60*1000 < new Date().getTime()){
								this.driverreg.uploadDrivingFlag = 1;
								this.driverreg.uploadDrivingMsg = '驾驶证已过期';
								uni.showModal({
									content: '您提交的驾驶证已过期，请重新修改后再提交',
									cancelText: '去申诉',
									cancelColor: '#999999',
									success: function (res) {
										if (res.confirm) {
											return
										} else if (res.cancel) {
											that._submit(1)
										}
									}		
								})
							}else {
								that._submit(2)
							}
						}
					}
				});
				// }
			} else {
				uni.showToast({
					title: '请完善信息！',
					icon: 'none'
				});
			}
		},
		fordata(validPeriod) {
			let reg = new RegExp("\\d{4}(-|/|.)\\d{2}(-|/|.)\\d{2}");
			let ret = reg.test(validPeriod);
			console.log(ret);
			if (!ret) {
				return "";
			} else {
				return validPeriod.match(reg)[0]
		  }
		},
		_submit(num) {
			let that = this
			that.driverreg.uploadDrivingFlag = that.driverreg.uploadDrivingFlag || 0
			that.driverreg.uploadIdCardBackFlag = that.driverreg.uploadIdCardBackFlag || 0
			that.driverreg.uploadIdCardFlag = that.driverreg.uploadIdCardFlag || 0
			
			that.wxRequest({
				url: `${that.API}/driverService/driverRegister`,
				method: 'POST',
				data: that.driverreg,
				title: '提交中...',
				success: res => {
					uni.setStorageSync(that.DATA_KEY.etpId, that.driverreg.etpId);
					uni.setStorageSync(that.DATA_KEY.etpName, that.driverreg.etpName);
					if(!that.driverreg.uploadDrivingFlag && !that.driverreg.uploadIdCardBackFlag && !that.driverreg.uploadIdCardFlag){
						that.livingcertification();			
					}
					// that.livingcertification();
					// #ifdef MP-WEIXIN
					that.onSubscribeMessage();
					// #endif
					uni.redirectTo({
						// url: '../personal/review?iscar=' + true
						url: '../personal/review?iscar=' + true + '&&num='+ num +'&&text=司机'
					});
				}
			});
		},
		oncard() {
			let that = this;
			uni.scanCode({
				scanType: ['qrCode'],
				success: function(res) {
					console.log('条码：' + JSON.stringify(res));
					that.driverreg.etpId = res.result.split('=')[2].split('&')[0];
					that.driverreg.etpName = res.result.split('=')[3].split('&')[0];
					that.etpName = res.result.split('=')[3].split('&')[0];
					if (res.result.split('=').length > 4) {
						that.driverreg.exemptCode = res.result.split('=')[4];
					}
					that.wxRequest({
						url: `${that.API}/driverService/checkInvitationCode`,
						method: 'POST',
						data: {
							driverId: uni.getStorageSync(that.DATA_KEY.userInfo).driverId,
							etpId: that.driverreg.etpId,
							exemptCode: that.driverreg.exemptCode
						},
						success: res => {}
					});
				}
			});
		},
		close(name) {
			this.$refs[name].close()
		},
		hindMobile(val) {
			if (val && typeof val === 'string') {
				var reg = /^(\d{3})\d*(\d{4})$/;
				return val.replace(reg,'$1****$2')
			}
		},
		// 人脸认证
		goFaceAuth() {
			debounce(async ()=>{
				const result2 = await this.getDriverIdCard();
				this.accessToken = result2.data.accessToken;
				const result3 = await this.getFaceQRCode(result2.data);
				let orderNumber = result3.data.orderNumber;
				this.orderNumber = orderNumber
				// const result4 = await this.updateFaceVerifyOrderNumber(orderNumber);
				let that = this
				// #ifdef APP-PLUS
				uni.showModal({
					title: '提示',
					content: '是否去进行实名认证?跳转进行实名认证后需要重新打开当前APP!',
					success: function(res) {
						if (res.confirm) {
							console.log('用户点击确定');
							that.close('changePhonePop');
							// uni.setStorageSync(that.DATA_KEY.liveFlag, true);
							plus.share.getServices(
								function(res) {
									uni.setStorageSync(that.DATA_KEY.backAccountFlag, true);
									var sweixin = null;
									console.log(res);
									for (var i = 0; i < res.length; i++) {
										var t = res[i];
										console.log(t);
										if (t.id == 'weixin') {
											sweixin = t;
										}
									}
									if (sweixin) {
										console.log('dddd=', 'a=' + sweixin + '=b');
										sweixin.launchMiniProgram({
											// id: 'gh_cec8224b00da',
											id: 'gh_45eec401ff1c',
											type: 0, //0-正式版 1.测试版，2，体验版
											path: 'pages/verify/info/index?id=' + orderNumber
										});
									}
								},
								function(res) {
									console.log(JSON.stringify(res));
								}
							);
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
				// #endif
				
				// #ifdef MP-WEIXIN
				uni.showModal({
					title: '提示',
					content: '是否去进行实名认证?',
					success: function(res) {
						if (res.confirm) {
							console.log('用户点击确定');
							that.close('changePhonePop');
							//uni.navigateToMiniProgram  打开另一个小程序
							uni.navigateToMiniProgram({
								// appId: 'wxfd2861dc1c86b3a0',
								appId: 'wxfc1e27e05fdd062b',
								path: 'pages/verify/info/index?id=' + orderNumber,
								envVersion: 'release',
								success(res) {
									uni.setStorageSync(that.DATA_KEY.backAccountFlag, true);
									console.log('跳转成功');
								},
								fail(res) {
									console.log('跳转失败' + JSON.stringify(res));
								}
							});
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
				// #endif
			},3000,true)
		},
		// 获取司机信息
		getDriverIdCard() {
			return new Promise((resolve, reject) => {
				let that = this
				this.wxRequest({
					url: `${that.API}/driverService/getDriverIdCard?idcard=${that.driverreg.idcard}&mobile=${that.changePhone.mobile}`,
					method: 'GET',
					data: {
						idcard: that.driverreg.idcard,
						mobile: that.changePhone.mobile,
					},
					title: '加载中...',
					success: (res => {
						if (res.data.code == 0) {
							resolve(res.data)
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: 'none'
							})
							reject(err)
						}
					}),
					fail: (err => {
						reject(err)
					})
				})
			})
		},
		// 根据司机信息获取人脸认证
		getFaceQRCode(data) {
			return new Promise((resolve, reject) => {
				let that = this
				this.wxRequest({
					url: `${that.API2}/api/face/getFaceQRCode?access_token=` + data.accessToken,
					method: 'POST',
					data: {
						companyTaxNumber: data.taxNumber,
						realName: data.driverName,
						idCard: data.idcard,
						idPhotoUp: data.idcard1Base64,
						idPhotoDown: data.idcard2Base64,
						callbackUrl: `${that.API}/driverService/isLivingBodyState`
					},
					title: '加载中...',
					success: (res => {
						if (res.data.code == 0) {
							resolve(res.data)
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: 'none'
							})
							reject(err)
						}
					}),
					fail: (err => {
						reject(err)
					})
				})
			})
		},
		// 更新人脸认证单号
		updateFaceVerifyOrderNumber(orderNumber) {
			return new Promise((resolve, reject) => {
				let that = this
				this.wxRequest({
					url: `${that.API}/driverService/updateFaceVerifyOrderNumber`,
					method: 'POST',
					data: {
						idcard: that.driverreg.idcard,
						mobile: that.changePhone.mobile,
						orderNumber: orderNumber,
						accessToken: that.accessToken
					},
					title: '加载中...',
					success: (res => {
						if (res.data.code == 0) {
							resolve(res.data)
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: 'none'
							})
							reject(err)
						}
					}),
					fail: (err => {
						reject(err)
					})
				})
			})
		},
		backLogin(mobile) {
			uni.navigateTo({
				url: '/pages/personal/login',
				success(res) {
					res.eventChannel.emit('login', { phone: mobile}) 
				}
			})
		},
		onBackAccount() {
			this.close('changePhoneTipsPop')
			this.$refs['changePhonePop'].open()
		},
		runGet() {
			this.checkPlatformDriver()
			setTimeout(() => {
				this.runNum++
				if (this.runNum < 3 && !this.isResult) {
					this.runGet()
				}
			},2000)
		},
		checkPlatformDriver() {
			let that = this
			this.wxRequest({
				url: `${that.API}/driverService/checkPlatformDriver?idcard=${that.driverreg.idcard}&mobile=${that.changePhone.mobile}`,
				method: 'GET',
				data: {
					idcard: that.driverreg.idcard,
					mobile: that.changePhone.mobile,
				},
				success: res => {
					if (res.data.code == 0) {
						this.type = 'success';
						this.isResult = true;
						let tel = that.isupdata ? that.newphone : that.userInfo.mobile;
						this.updateDriverTel()
						uni.hideLoading()
						uni.navigateTo({
							url: '/pages/account/resutl?type=success&tel='+tel,
							success() {
								
							}
						})
					} else {
						if (this.runNum == 2) {
							this.type = 'fail';
							this.isResult = true
							uni.hideLoading()
							uni.navigateTo({
								url: '/pages/account/resutl?type=fail&id='+that.orderNumber,
								success() {
									
								}
							})
						}
					}
				},
			})
		},
		updateDriverTel() {
			this.wxRequest({
				url: `${this.API}/driverService/updateDriverTel`,
				method: 'POST',
				data: {
					tel: this.isupdata ? this.newphone : this.userInfo.mobile,
					mobile: this.changePhone.mobile,
					mod: 2
				},
				success: (res => {
					console.log('修改成功')
				})
			})
		},
	},
	onLoad: function(options) {
		this.userInfo = uni.getStorageSync(this.DATA_KEY.userInfo);
		// this.isdriverId = options.isdriverId;
		if (this.userInfo.etpId) {
			this.isdriverId = true;
		}

		// this.wxRequest({
		// 	url: `${this.API}/user/info/query`,
		// 	method: 'POST',
		// 	data: {
		// 		mobile: this.userInfo.mobile
		// 	},
		// 	title: '加载中...',
		// 	success: res => {
		// 		if (JSON.stringify(res.data.data) != '{}') {
		// 			this.driverreg = res.data.data;
		// 		}
		// 	}
		// });
		this.wxRequest({
			url: `${this.API}/driverService/getEtpList?is_enable=1`,
			method: 'POST',
			success: res => {
				this.carrieritems = res.data.data.list;
				this.etpName = this.driverreg.etpName
				console.log(this.driverreg)
				console.log('=============>', this.carrieritems);
			}
		});
		if (this.isdriverId) {
			let driverId = this.userInfo.driverId;
			this.wxRequest({
				url: `${this.API}/driverService/getDriverInfoByDriverID?driver_id=` + driverId + '&etp_id=' + uni.getStorageSync(this.DATA_KEY.etpId),
				method: 'POST',
				title: '加载中...',
				success: res => {
					this.driverreg = res.data.data.userModel;
					this.driverreg.driverName = res.data.data.userModel.driverName || res.data.data.userModel.driverName;
					this.driverreg.idcard = res.data.data.userModel.idcard || res.data.data.userModel.idcard;
					this.driverreg.tqc = res.data.data.userModel.tqc;
					this.driverreg.idcardValidDate = res.data.data.userModel.idcardStartDate + '-' + res.data.data.userModel.idcardEndDate;
					this.driverreg.idcardStartDate = res.data.data.userModel.idcardStartDate;
					this.driverreg.idcardEndDate = res.data.data.userModel.idcardEndDate;
					this.driverreg.driverStartDate = res.data.data.userModel.driverStartDate;
					this.driverreg.driverEndDate = res.data.data.userModel.driverEndDate;
					this.driverreg.driverLcsValidDate = res.data.data.userModel.driverStartDate + '-' + res.data.data.userModel.driverEndDate;

					// let that = this;
					// that.wxRequest({
					// 	url: `${that.API}/driverService/getDriverIdCardInfo`,
					// 	method: 'POST',
					// 	data: {
					// 		driverId: driverId,
					//      platformCoNo: that.platformCoNo
					// 	},
					// 	title: '加载中...',
					// 	success: res => {
					// 		that.idPhotoUp = res.data.data.idcard1Base64;
					// 		that.idPhotoDown = res.data.data.idcard2Base64;
					// 	}
					// });
				}
			});
		}
		this.driverreg.etpId = options.etpId;
		console.log(this.driverreg.etpId,333)
		this.driverreg.etpName = options.etpName;
		console.log(this.driverreg.etpName)
		// this.etpName = options.etpName;
		this.driverreg.exemptCode = options.exemptCode;
		let that = this;
		that.wxRequest({
			// 获取ip
			url: `${that.API}/driverService/getIp`,
			success(res) {
				that.ipAddress = res.data.data.ip
			}
		});
		uni.getSystemInfo({
			success: function(res) {
				that.macAddress = res.deviceId;
				console.log('macAddress ,', res.deviceId);
			}
		});
	},
	async onShow(options) {
		if (uni.getStorageSync(this.DATA_KEY.backAccountFlag)) {
			this.runNum = 0;
			this.isResult = false
			uni.setStorageSync(this.DATA_KEY.backAccountFlag, false);
			await this.updateFaceVerifyOrderNumber(this.orderNumber)
			// this.checkPlatformDriver()
			uni.showLoading({
				title: '加载中...'
			})
			this.runGet()
		}
	},
	onUnload() {
		if(uni.getStorageSync(this.DATA_KEY.backAccountFlag)){
			uni.setStorageSync(this.DATA_KEY.backAccountFlag, false);
		}
	},
};
</script>

<style lang="scss">
	.popup-wrap{
		// padding: 0 24rpx calc(24rpx + env(safe-area-inset-bottom));
		padding: 0 24rpx calc(24rpx);
		color: #007aff;
		text-align: center;
		background: transparent;
		.popup-describe{
			color: #fff;
			position: absolute;
			top: -55vh;
			left: 50%;
			transform: translate(-50%, 0);
			.title{
				margin: 24rpx 0;
				font-size: 36rpx;
			}
			.desc{
				font-size: 24rpx;
			}
		}
		.popup-box{
			background: #fff;
			margin-bottom: 24rpx;
			border-radius: 8rpx;
			view{
				padding: 24rpx 0;
				&:first-child{
					border-bottom: 1rpx solid #f9f9f9;
				}
			}
		}
		.popup-cancel{
			background: #fff;
			padding: 24rpx 0;
			border-radius: 8rpx;
		}
	}
page {
	background: #ffffff;
}
.desc-css{
	font-size: 24rpx;
	color: #4175F7;
	padding: 0 30rpx;
}
.row-css {
	display: flex;
	flex-direction: row;
}

.column-css {
	display: flex;
	flex-direction: column;
}
.view-cente {
	background: #ffffff;
	padding: 0 30rpx;
}
.view-cente-cle {
	padding: 25rpx 0;
	border-bottom: 1rpx solid #eeeeee;
}
.view-cente-cle-text {
	width: 180rpx;
	color: #5f6579;
}
.code-view {
	display: flex;
	width: 230rpx;
	font-size: 28rpx;
	color: #ffffff;
	background: #2979ff;
	justify-content: center;
	align-items: center;
	border: 1rpx solid #2979ff;
	padding: 15rpx 0;
}
.view-button {
	display: flex;
	flex: 1;
	background: #2b7cff;
	border-radius: 5rpx;
	padding: 20rpx;
	margin: 30rpx;
	/* margin-top: 50rpx; */
	justify-content: center;
	color: #ffffff;
}
.ul {
	position: absolute;
	margin-top: 30rpx;
	left: 0;
	top: 100%;
	width: 100%;
	background: #ffffff;
}
.li {
	border-bottom: 1rpx solid #eeeeee;
	padding: 25rpx 20rpx;
}

.unipop__ui_body {
		background-color: #fff;
		border-radius: 12px;
		text-align: center;
		position: relative;
	}
	@media screen and (min-width: 352px) {
		.unipop__ui_body {
			width: 320px;
		}
	}
	
	.unipop__ui_tit {
		padding: 32px 24px 16px;
		font-size: 17px;
		color: rgba(0, 0, 0, 0.9);
		font-weight: 700;
		font-size: 17px;
		line-height: 1.4;
		position: relative;
	}
	.unipop__ui_close {
		position: absolute;
		right: 15px;
		top: 15px;
		
	}
	.unipop__ui_cnt {
		padding: 0 24px;
		margin-bottom: 32px;
		font-size: 17px;
		line-height: 1.4;
		word-wrap: break-word;
		color: rgba(0, 0, 0, 0.5);
	}
	.unipop__ui_btns {
		display: flex;
		position: relative;
	}
	.unipop__ui_btns::after {
		content: " ";
		position: absolute;
		left: 0;
		top: 0;
		right: 0;
		height: 1px;
		border-top: 1px solid rgba(0,0,0,0.1);
		color: rgba(0,0,0,0.1);
		transform-origin: 0 0;
		transform: scaleY(0.5);
	}
	// .unipop__ui_btns .btn {
	// 	flex: 1;
	// 	font-size: 17px;
	// 	line-height: 1.4;
	// 	font-weight: 600;
	// 	color: #576b95;
	// 	padding: 16px 23px;
	// 	user-select: none;
	// 	position: relative;
	// }
	// .unipop__ui_btns .btn.btn-default {
	// 	color: rgba(0, 0, 0, 0.9);
	// }
	// .unipop__ui_btns .btn:first-child::after {
	// 	display: none;
	// }
	// .unipop__ui_btns .btn::after {
	// 	content: " ";
	// 	position: absolute;
	// 	left: 0;
	// 	top: 0;
	// 	width: 1px;
	// 	bottom: 0;
	// 	border-left: 1px solid rgba(0,0,0,0.1);
	// 	color: rgba(0,0,0,0.1);
	// 	transform-origin: 0 0;
	// 	transform: scaleX(0.5);
	// }
	
	.cp-tip {
		color: #333;
		font-size: 15px;
		&.old-phone {
			text-align: left;
			padding-top: 20px;
		}
	}
	.code-btn {
		background-color: #2979ff;
		color: #fff;
		font-size: 12px;
		height: 28px;
		width: 80px;
		padding: 0 10px;
	}
	.auth-btn {
		background-color: #2979ff;
		color: #fff;
		margin: 10px auto;
		padding: 0 20px;
	}
</style>
